package com.waterdrop.wlsggk.service.impl;


import com.waterdrop.wlsggk.mapper.MaterialMapper;
import com.waterdrop.wlsggk.pojo.Material;
import com.waterdrop.wlsggk.service.MaterialService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 物料库信息 服务层处理
 *
 * @author ruoyi
 */
@Service
public class MaterialServicelmpl implements MaterialService {

    @Autowired
    private MaterialMapper materialMapper;

    /**
     * 查询物料数据集合
     *
     * @param material 物料信息
     * @return 物料数据集合
     */
    @Override
    public List<Material> selectMaterialList(Material material) {
        return materialMapper.selectMaterialList(material);
    }

    /**
     * 删除物料信息
     *
     * @param ids 物料ID
     * @return 结果
     */
    @Override
    public int deleteWlsggkMaterial(Long[] ids) {
        return materialMapper.deleteWlsggkMaterialByIds(ids);
    }


    /**
     * 根据物料id查询信息
     *
     * @param id 物料ID
     * @return 结果
     */
    @Override
    public Material selectWlsggkMaterialById(Long id) {

        return materialMapper.selectwlsggkMaterialById(id);
    }

    /**
     * 添加物料
     *
     * @param material 物料信息
     * @return 结果
     */
    @Override
    public int insertWlsggkMaterial(Material material) {

        return materialMapper.insertWlsggkMaterial(material);
    }

    /**
     * 修改物料
     *
     * @param material 物料信息
     * @return 结果
     */

    @Override
    public int updateWlsggkMaterial(Material material) {
        return materialMapper.updateWlsggkMaterial(material);
    }
}
